<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
.ipt_113{
	width:80px;
	height:auto;
	border:1px solid #e5e5e5;
	font-size:14px;
	background:none;
	border-radius:5px;
}
</style>
<#include "/common/resources.ftl"/>
<script type="text/javascript" charset="utf-8" src="${js}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${js}/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="${js}/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	function m_submit(){
	   // alert(window.saveOrEditForm);
	   if($('#saveOrEditForm').form('validate')){
	      window.saveOrEditForm.submit();
	   }
		
	}
	
	function m_back(){
		window.location.href = 'manage';
	}
	<#if errorMsg?exists >alert('${errorMsg}');</#if>
	function initHide(){
	    var productRadio=$("input[name='estimateZg']:checked").val();
        if(productRadio=="0"){
           $("#hidden_div").hide();
        }
	}
	$(function(){
	    initHide();
	    
		/*$("#province").on("change",function(){
			var val = $(this).val();
			if(val){
				$.ajax({
					url:"${ctx}/qfbao/product/findCity",
					type: "POST",
					data:{"id":val},
					dataType:"json",
					success:function(data){
						if(data){
							var html="";
							for(var i=0;i<data.citys.length;i++){
								html+= "<option value='"+data.citys[i].id+"'>"+data.citys[i].name+"</option>";
							}
							$("#cityId").html(html);
						}
					}
				})
			}else{
				$("#cityId").html("<option value=''>--请选择--</option>");
			}
		});*/
		//$("#province").on("change",function(){
		$("#province").combobox({
		onChange: function (n,o) {
			//var val = $(this).val();
			var val = n;
			/*if(val){
				$.ajax({
					url:"${ctx}/qfbao/product/findCity",
					type: "POST",
					data:{"id":val},
					dataType:"json",
					success:function(data){
						if(data){
							var html="";
							for(var i=0;i<data.citys.length;i++){
								html+= "<option value='"+data.citys[i].id+"'>"+data.citys[i].name+"</option>";
							}
							$("#cityId").html(html);
						}
					}
				})
			}else{
				$("#cityId").html("<option value=''>--请选择--</option>");
			}*/
			cityId.combobox({
                        disabled: false,
                        url: '${ctx}/qfbao/product/findCity?id=' + n,
                        valueField: 'id',
                        textField: 'name'
                    }).combobox('clear');
		}});
		var cityId = $('#cityId').combobox({
                disabled: true,
                valueField: 'id',
                textField: 'fullName'
            });
		/*$("#dprovince").on("change",function(){
			var val = $(this).val();
			if(val){
				$.ajax({
					url:"${ctx}/qfbao/product/findCity",
					type: "POST",
					data:{"id":val},
					dataType:"json",
					success:function(data){
						if(data){
							var html="";
							for(var i=0;i<data.citys.length;i++){
								html+= "<option value='"+data.citys[i].id+"'>"+data.citys[i].name+"</option>";
							}
							$("#dcityId").html(html);
						}
					}
				})
			}else{
				$("#dcityId").html("<option value=''>--请选择--</option>");
			}
		});*/
		//$("#province").on("change",function(){
		$("#dprovince").combobox({
		onChange: function (n,o) {
			var val = n;
			dcityId.combobox({
                        disabled: false,
                        url: '${ctx}/qfbao/product/findCity?id=' + n,
                        valueField: 'id',
                        textField: 'name'
                    }).combobox('clear');
		}});
		var dcityId = $('#dcityId').combobox({
                disabled: true,
                valueField: 'id',
                textField: 'fullName'
            });
		<#if areaFu?exists >$("#province").combobox('setValue','${areaFu.id}')</#if>
		<#if area?exists >$("#cityId").combobox('setValue','${area.id}')</#if>
		<#if areaFu2?exists >$("#dprovince").combobox('setValue','${areaFu2.id}')</#if>
		<#if area2?exists >$("#dcityId").combobox('setValue','${area2.id}')</#if>
		<#if model?exists >$("#ifCommission").combobox('setValue','${model.ifCommission}')</#if>
        $("#estimateZg").change(function(){
            if($(":radio:checked").attr("id")=="estimateZg"){//根据id号判断哪个radio被选中
                //选择了是
                $("#hidden_div").show();
            }else{
                //选择了否
                $("#hidden_div").hide();
            }
        });
        $("#estimateZg1").change(function(){
            if($(":radio:checked").attr("id")=="estimateZg1"){//根据id号判断哪个radio被选中
                //选择了否
                $("#hidden_div").hide();
            }else{
                //选择了是
                $("#hidden_div").show();
            }
        });
	})
    function docheck(){
        var a=function(){
            alert(123);
        }
        return a();
    }


</script>
</head>
<body>
  <form action="${ctx}/qfbao/product/save_edit" method="post" class="loan_list_form" name="saveOrEditForm" id="saveOrEditForm">
  <input type="hidden" name="id" value="<#if model?exists >${model.id}</#if>" />
  <input type="hidden" name="loanAssessId" value="<#if loanAssess?exists >${loanAssess.id}</#if>" />
  <div class="fm_sty" style="margin: 20px 0px 0px;">
          <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">
				【基本信息】
			</span>
       	</div>
	       	<div class="ipt_line_2">
				<span class="ipt_title">产品名称</span>
				<input class="easyui-validatebox" style="height:39px; width:263px;" data-options="required:true" type="text"  name="name" value="<#if model?exists >${model.name}</#if>" />
			</div>
            

			
			<div class="ipt_line_2">
				<span class="ipt_title">项目经理</span>
				<input required="true" class="easyui-validatebox" style="height:39px; width:263px;" type="text" name="projectManager" value="<#if model?exists >${model.projectManager}</#if>" />
			</div>
			
			<div class="ipt_line_2">
				<span class="ipt_title">联系方式</span>
				<input required="true" maxlength="11" type="text" name="contactInformation" value="<#if model?exists >${model.contactInformation}</#if>"  class="easyui-numberbox" style="height:39px; width:263px;" />
			</div>
			

			<div class="ipt_line_2">
				<span class="ipt_title">还款方式</span>
				<select required="true" name="repaymentId" class="easyui-combobox" style="height:39px; width:263px;">
					<option value=""></option>
					<#list repayments as p>
						<option <#if model?exists && model.repaymentId== p.id>selected</#if> value="${p.id}">${p.dicName}</option>
					</#list>
				</select>
			</div>
      
	       	<div class="ipt_line_2">
				<span class="ipt_title">产品类型</span>
				<select  required="true" name="productType" class="easyui-combobox" style="height:39px; width:263px;">
					<option value=""></option>
					<#list products as p>
						<option <#if model?exists && model.productType== p.id>selected</#if> value="${p.id}">${p.dicName}</option>
					</#list>
				</select>
			</div>
			
				       	<div class="ipt_line_2">
				<span class="ipt_title">所属公司</span>
				<select  required="true" name="companyId" class="easyui-combobox" style="height:39px; width:263px;">
					<option value=""></option>
					<#list infos as p>
						<option <#if model?exists && model.companyId== p.id>selected</#if> value="${p.id}">${p.companyName}</option>
					</#list>
				</select>
			</div>
        
        	<div class="ipt_line_2">
				<span class="ipt_title">所属省份</span>
				
				<input  required="true" name="province" id="province" class="easyui-combobox" style="height:39px; width:263px;"
					data-options="
						valueField:'id',
						textField:'fullName',
						url:'${ctx}/qfbao/product/findProvince'" />
			</div>
	       	<div class="ipt_line_2">
				<span class="ipt_title">所属城市</span>
				
				<input  required="true" name="cityId" id="cityId" class="easyui-combobox" style="height:39px; width:263px;"/>
			</div>
			
			
			<div class="ipt_line_2">
				<span class="ipt_title">贷款额度(万)</span>
				<input type="text" name="minCredits" value="<#if model?exists >${model.minCredits}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:110px;"/>
				~
				<input required="true" type="text" name="maxCredits" value="<#if model?exists >${model.maxCredits}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:110px;"/>
				
			</div>
			
			<div class="ipt_line_2">
				<span class="ipt_title">贷款期限</span>
				<#if dkqx?exists>
				    <input type="text" name="minTerm" value="${dkqx.startProcedure!''}" class="easyui-numberbox" data-options="min:1,precision:0" style="height:39px; width:60px;"/>
					<select class="easyui-combobox" style="height:39px; width:58px;" name="minTermUnit">
						<option value="2" <#if dkqx.startUnit=='2'> selected </#if>>年</option>
						<option value="1" <#if dkqx.startUnit=='1'> selected </#if>>月</option>
						<option value="0" <#if dkqx.startUnit=='0'> selected </#if>>日</option>
					</select>
					~
					<input type="text" name="maxTerm" value="${dkqx.endProcedure!''}" class="easyui-numberbox" data-options="min:1,precision:0" style="height:39px; width:60px;"/>
					<select class="easyui-combobox" style="height:39px; width:58px;" name="maxTermUnit">
						<option value="2" <#if dkqx.endUnit=='2'> selected </#if>>年</option>
						<option value="1"<#if dkqx.endUnit=='1'> selected </#if>>月</option>
						<option value="0"<#if dkqx.endUnit=='0'> selected </#if>>日</option>
					</select>
				<#else>
				    <input type="text" name="minTerm" class="easyui-numberbox" data-options="min:1,precision:0" style="height:39px; width:60px;"/>
					<select class="easyui-combobox" style="height:39px; width:58px;" name="minTermUnit">
						<option value="2">年</option>
						<option value="1">月</option>
						<option value="0">日</option>
					</select>
					~
					<input type="text" name="maxTerm" class="easyui-numberbox" data-options="min:1,precision:0" style="height:39px; width:60px;"/>
					<select class="easyui-combobox" style="height:39px; width:58px;" name="maxTermUnit">
						<option value="2">年</option>
						<option value="1">月</option>
						<option value="0">日</option>
					</select>
				</#if>
				
			</div>
			
			
			<div class="ipt_line_2">
			<span class="ipt_title">贷款利率</span>
			<#if dkll?exists>
				<input type="text" name="minRate" value="${dkll.startProcedure!''}" required="true" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:80px;"/>
				~
				<input type="text" name="maxRate" value="${dkll.endProcedure!''}" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:80px;"/>
				<select class="easyui-combobox" style="height:39px; width:76px;" name="rateUnit">
					<option value="2" <#if dkll.endUnit=='2'> selected </#if>>%年</option>
					<option value="1" <#if dkll.endUnit=='1'> selected </#if>>%月</option>
					<option value="0" <#if dkll.endUnit=='0'> selected </#if>>%日</option>
				</select>
		    <#else>
				<input type="text" name="minRate" required="true" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:80px;"/>
				~
				<input type="text" name="maxRate" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:80px;"/>
				<select class="easyui-combobox" style="height:39px; width:76px;" name="rateUnit">
					<option value="2">%年</option>
					<option value="1">%月</option>
					<option value="0">%日</option>
				</select>
		    </#if>
			</div>
			
			<div class="ipt_line_2">
			  <span class="ipt_title">用户手续费</span>
			  <#if sxf?exists>
				<input name="minFee" type="text" value="${sxf.startProcedure!''}" class="easyui-numberbox" data-options="min:0.01,precision:2" style="height:39px; width:80px;"/>
				~
				<input name="maxFee" type="text" value="${sxf.endProcedure!''}" class="easyui-numberbox" data-options="min:0.01,precision:2" style="height:39px; width:80px;"/>
				<select class="easyui-combobox" style="height:39px; width:76px;" name="feeUnit">
					<option value="2" <#if dkqx.endUnit=='2'> selected </#if>>%年</option>
					<option value="1" <#if dkqx.endUnit=='1'> selected </#if>>%月</option>
					<option value="0" <#if dkqx.endUnit=='0'> selected </#if>>%日</option>
				</select>
			  <#else>
			    
				<input name="minFee" type="text" class="easyui-numberbox" data-options="min:0.01,precision:2" style="height:39px; width:80px;"/>
				~
				<input name="maxFee" type="text" class="easyui-numberbox" data-options="min:0.01,precision:2" style="height:39px; width:80px;"/>
				<select class="easyui-combobox" style="height:39px; width:76px;" name="feeUnit">
					<option value="2" >%年</option>
					<option value="1" >%月</option>
					<option value="0" >%日</option>
				</select>
			  </#if>

			</div>
			
			<div class="ipt_line_2">
				<span class="ipt_title">最快放款天数</span>
				<input class="easyui-validatebox" style="height:39px; width:263px;" class="easyui-numberbox" data-options="min:0,max:99,precision:0,required:true" type="text"  name="fastLoanDay" value="<#if model?exists >${model.fastLoanDay}</#if>" />
			</div>
            

			
			<div class="ipt_line_2">
				<span class="ipt_title">排序</span>
				<input required="true" class="easyui-numberbox" style="height:39px; width:263px;" data-options="min:0,max:5,precision:0,required:true" type="text" name="sort" value="<#if model?exists >${model.sort}</#if>" />
			</div>
			


		 <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">【销售&分佣信息】
			</span>
       	</div>
       	     
       	    
				  
			 <div class="ipt_line_2">
				<span class="ipt_title">总手续费</span>
				<input required="true" type="text" name="dkServiceFees" value="<#if model?exists >${model.dkServiceFees}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:263px;" />％
			</div>

	
	       	<div class="ipt_line_2">
				<span class="ipt_title">平台分佣</span>
				<input required="true"  type="text" name="platformSubCommission" value="<#if model?exists >${model.platformSubCommission}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:263px;" />％
			</div>
       
	       	<div class="ipt_line_2">
				<span class="ipt_title">中介分佣</span>
				<input required="true" type="text" name="agencySubCommission" value="<#if model?exists >${model.agencySubCommission}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:263px;" />％
			</div>
			
			<div class="ipt_line_2">
				<span class="ipt_title">报备奖励(元)</span>
				<input type="text" name="reportReward" value="<#if model?exists >${model.reportReward}</#if>" class="easyui-numberbox" data-options="min:0,precision:2" style="height:39px; width:263px;" />
			</div>
			
			<div class="ipt_line_2">
				<span class="ipt_title">是否返佣</span>
				<select id="ifCommission" required="true" class="easyui-combobox" style="height:39px; width:263px;" name="ifCommission">
					<option value="" ></option>
					<option value="0" >是</option>
					<option value="1" >否</option>
				</select>
			</div>
      
         <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">
				申请条件
			</span>
       	</div>
	       	<div class="ipt_line">
				<!--<input type="text" name="conditionDesc" value="<#if model?exists >${model.conditionDesc}</#if>" class="ipt_226" />-->
				<textarea name="conditionDesc" id="conditionDesc" ><#if model?exists >${model.conditionDesc}</#if></textarea>  
				<script type="text/javascript">
		          var ue = UE.getEditor('conditionDesc',{  
		              toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','bold','test']],  
		              autoClearinitialContent:false,  
		              wordCount:false,  
		              elementPathEnabled:false,  
		              initialFrameHeight:80,
		              zIndex:0,
		              lang:"zh-cn"
		          });
		       </script> 
			</div>
     
        <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">
				所需材料
			</span>
       	</div>
	       	<div class="ipt_line">
				<!--<input type="text" name="materialDesc" value="<#if model?exists >${model.materialDesc}</#if>" class="ipt_226" />-->
				<textarea name="materialDesc" id="materialDesc" ><#if model?exists >${model.materialDesc}</#if></textarea>  
				<script type="text/javascript">
		          var ue = UE.getEditor('materialDesc',{  
		              toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','bold','test']], 
		              autoClearinitialContent:false,  
		              wordCount:false,  
		              elementPathEnabled:false,  
		              initialFrameHeight:80,
		              zIndex:0,
		              lang:"zh-cn"
		          });
		       </script> 
			</div>
			
		
         <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">
				贷款费用
			</span>
       	</div>
	       	<div class="ipt_line">
				
				<textarea name="applyAmount" id="applyAmount" ><#if model?exists >${model.applyAmount}</#if></textarea>  
				<script type="text/javascript">
		          var ue = UE.getEditor('applyAmount',{  
		              toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','bold','test']],  
		              autoClearinitialContent:false,  
		              wordCount:false,  
		              elementPathEnabled:false,  
		              initialFrameHeight:80,
		              zIndex:0,
		              lang:"zh-cn"
		          });
		       </script> 
			</div>	
			
			
			
			
			
		

      
         <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		<span style="position:absolute;top:-12px;left:17px;background:#fff;padding:0 8px;font-size: 16px;font-weight:bold;">
				返佣说明
			</span>
       	</div>
	       	<div class="ipt_line">
				<textarea name="intermediary" id="intermediary" ><#if model?exists >${model.intermediary}</#if></textarea>  
				<script type="text/javascript">
		          var ue = UE.getEditor('intermediary',{  
		              toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','bold','test']],  
		              autoClearinitialContent:false,  
		              wordCount:false,  
		              elementPathEnabled:false,  
		              initialFrameHeight:80,
		              zIndex:0,
		              lang:"zh-cn"
		          });
		       </script> 
			</div>	
        
		<div id="hidden_div">
        <div class="detail_slip" style="position:relative;margin-bottom:20px">
       		
       	</div>
       	
       	

     
      <div class="ipt_line_long">
            <button class="red_100" onclick="javascript:m_submit();return false;">保存</button>
            <button class="red_100" onclick="javascript:m_back();return false;" style="background-color:#74D86A">返回</button>
      </div>
	</div>
	</form>
</body>
</html>
